package injections;

import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

/**
 * Created by rehak on 2/11/14.
 */
public class DefinedInjection {

    private final String rootInstanceName;
    private final List<DefinedClass> classes = new CopyOnWriteArrayList<>();

    public DefinedInjection(String rootInstanceName, Collection<DefinedClass> classes) {
        this.rootInstanceName = rootInstanceName;
        if (classes != null) {
            this.classes.addAll(classes);
        }
    }

    public String getRootInstanceName() {
        return rootInstanceName;
    }

    public List<DefinedClass> getClasses() {
        return Collections.unmodifiableList(classes);
    }
}
